package com.superatom.springboot.utils;

import com.superatom.springboot.domain.Result;

public class ResultUtils {

    public static Result success(Object data){
        Result result = new Result();
        result.setCode(0);
        result.setMessgae("成功");
        result.setData(data);
        return result;
    }

    public static Result success(){
        return success(null);
    }

    public static Result error(Integer code, String msg){
        Result result = new Result();
        result.setCode(code);
        result.setMessgae(msg);
        result.setData(null);
        return result;
    }
}
